import request from '@/utils/request'
import qs from 'qs'

export function login(data) {
  return request({
    url: '/api/key/login',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function ping() {
  return request({
    url: '/api/key/ping',
    method: 'get'
  })
}
export function getList(s) {
  return request({
    url: '/api/key/list',
    method: 'post',
    data: qs.stringify({
      sx: s
    })
  })
}

export function getKey(key) {
  return request({
    url: '/api/key/pub/getKey',
    method: 'post',
    data: qs.stringify({
      key
    })
  })
}
export function setTtl(key, ttl) {
  return request({
    url: '/api/key/setTtl',
    method: 'post',
    data: qs.stringify({
      key,
      ttl
    })
  })
}

export function delKey(key) {
  return request({
    url: '/api/key/del',
    method: 'post',
    data: qs.stringify({
      key
    })
  })
}

